home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2008 September
/
PCWorld_2008-09_cd.bin
/
v cisle
/
sadanastroju
/
bookmark_previews-0.6.5-fx.xpi
/
chrome
/
content
/
placestreeview.js
< prev
next >
Wrap
Text File
|
2008-05-27
|
4KB
|
110 lines
function extendPreviewView(view,tree){
view._treeType = tree;
for (var p in PlacesPreviewTreeView.prototype){
if (p in view){
view[("_"+p)] = view[p];
view[p] = PlacesPreviewTreeView.prototype[p];
} else {
view[p] = PlacesPreviewTreeView.prototype[p];
}
}
}
function PlacesPreviewTreeView(view,tree) {
//dump("new places tree view\n");
this._treeType = tree;
this._view = view;
}
PlacesPreviewTreeView.prototype = {
itemInserted: function(parent, item, newIndex) {
if (PlacesPreviewUtils.loading) return;
this.___LOG("item inserted: "+item.title);
this.lastItem = item.itemId;
if (this._itemInserted)
this._itemInserted.apply(this,arguments);
PlacesPreviewUtils.utils.refreshDisplay(true);
if (PlacesPreviewUtils.selected == "thumbnails"){
/* select inserted item */
ThumbView.selectNode(item);
}
},
itemRemoved: function(parent, item, oldIndex) {
if (PlacesPreviewUtils.loading) return;
this.___LOG("item removed: "+item.title);
this.lastItem = item.itemId;
if (this._itemRemoved)
this._itemRemoved.apply(this,arguments);
PlacesPreviewUtils.utils.refreshDisplay(true);
},
itemChanged: function(item) {
if (PlacesPreviewUtils.loading) return;
this.___LOG("item changed: "+item.title);
if (this._itemChanged)
this._itemChanged.apply(this,arguments);
},
itemReplaced: function(parent, oldItem, newItem, index) {
if (PlacesPreviewUtils.loading) return;
this.___LOG("itemReplaced: " + newItem.uri);
this.lastItem = item.itemId;
if (this._itemReplaced)
this._itemReplaced.apply(this,arguments);
PlacesPreviewUtils.utils.refreshDisplay(true);
},
itemMoved: function(item, oldParent, oldIndex, newParent, newIndex) {
if (PlacesPreviewUtils.loading) return;
this.___LOG("item moved\n");
this.lastItem = item.itemId;
if (this._itemMoved)
this._itemMoved.apply(this,arguments);
PlacesPreviewUtils.utils.refreshDisplay(true);
},
containerOpened: function(item) {
if (PlacesPreviewUtils.loading) return;
this.___LOG("container opened: "+item.title);
//dump("called: "+arguments.callee.caller.caller+"\n");
if (this._containerOpened)
this._containerOpened.apply(this,arguments);
if (!PlacesPreviewUtils.utils.updatedSelection){
setTimeout(function PPTV_containerOpen(){
if (PlacesPreviewUtils.utils)
PlacesPreviewUtils.utils.refreshDisplay(true);
},0);
}
},
containerClosed: function(item) {
if (PlacesPreviewUtils.loading) return;
this.___LOG("container closed: "+item.title);
if (this._containerClosed)
this._containerClosed.apply(this,arguments);
},
invalidateContainer: function(item) {
if (PlacesPreviewUtils.loading) return;
this.___LOG("invalidateContainer(): "+item.title);
if (this._invalidateContainer)
this._invalidateContainer.apply(this,arguments);
},
invalidateAll: function() {
if (PlacesPreviewUtils.loading) return;
this.___LOG("invalidateAll\n");
if (this._invalidateAll)
this._invalidateAll.apply(this,arguments);
setTimeout(function(){
PlacesPreviewUtils.utils.refreshDisplay(true);
},0);
},
//sortingChanged: function(sortingMode) {
// //dump("tree: "+this._treeType+" - "+"sorting changed: "+sortingMode+"\n");
// this._sortingChanged.apply(this,arguments);
//}
___LOG : function(aText){
dump("tree: "+this._treeType+" - "+aText+"\n");
}
};
function PlacesThumbView(aShowRow, aFlatList){
}
PlacesThumbView.prototype = {
addViewObserver: function(observer, ownsWeak) {},
removeViewObserver: function(observer) {}
};